package com.heima.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

@Component
public class TestListener {


//    @KafkaListener(topics = "abc-topic", groupId = "group101")
//    public void listener(String message) {
//        System.out.println(message);
//    }
//
//
//    @KafkaListener(topics = "abc-topic", groupId = "group102")
//    public void listener2(String message) {
//        System.out.println(message);
//    }
@KafkaListener(topics = "abc-topic")
public void onMessage2(ConsumerRecord<String, String> record, Acknowledgment acknowledgment) {
    System.out.println(record.value());
    acknowledgment.acknowledge();
}

}